<div class="navButtonsTop rounded-corners">
	<g:if test="${alterPageInstanceList[0]}">
	<h1 class="title"><g:message code="title.alterPage.list" args="[alterPageInstanceList[0].page.title]"/></h1>
	</g:if>
</div>

<div class="element rounded-corners">
	<g:if test="${alterPageInstanceList}">
		<g:if test="${session.alterPageViewMode == 'flow'}">
			<div class="rounded-corners scroll">
	  			<g:each in="${alterPageInstanceList}" status="i" var="alterPageInstance">
			    	<div class="item ${alterPageInstance.disabled ? 'disableItem' : ''}">
			    		<img class="portada" src="${resource(file:alterPageInstance?.pathFileThumbnail)}" />
						
						<div class="resumen">
							<label>${alterPageInstance.title}</label>
						</div>
						
						<div class="botones">
							<g:form class="actionDefault" controller="alterPage" action="show">
								<g:hiddenField name="id" value="${alterPageInstance?.id}"/>
								<g:submitButton class="itemButton showDetails" name="showDetails" value="${message(code:'showDetails')}" />
							</g:form>
						</div>
					</div>
				</g:each>
			</div>
		</g:if>
		
		<g:if test="${session.alterPageViewMode == 'list'}">
			<div class="tableList rounded-corners">
				<table>
		            <thead>
		                <tr>
			           	    <g:sortableColumn property="id" titleKey="alterPage.id" />
			           	    <g:sortableColumn property="title" titleKey="alterPage.title" />
			           	    <g:sortableColumn property="description" titleKey="alterPage.description" />
			           	    <g:sortableColumn property="nameFile" titleKey="alterPage.nameFile" />
			           	    <g:sortableColumn property="disabled" titleKey="alterPage.disabled" />
			           	    <th><g:message code="alterPage.createdBy"/></th>
		                </tr>
		            </thead>
		            <tbody>
			            <g:each in="${alterPageInstanceList}" status="i" var="alterPageInstance">
			                <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
			                    <td><g:link action="show" id="${alterPageInstance.id}">${fieldValue(bean: alterPageInstance, field: "id")}</g:link></td>
			                    <td>${fieldValue(bean: alterPageInstance, field: "title")}</td>
			                    <td>${fieldValue(bean: alterPageInstance, field: "description")}</td>
			                    <td>${fieldValue(bean: alterPageInstance, field: "nameFile")}</td>
			                    <td><g:formatBoolean boolean="${alterPageInstance.disabled}" /></td>
			                    <td>${fieldValue(bean: alterPageInstance, field: "createdBy")}</td>
			                </tr>
			            </g:each>
		            </tbody>
		        </table>
			</div>
		</g:if>
	</g:if>
	
	<g:else>
		<div class="rounded-corners noData" >
			<g:message code="default.no.alterPages"/>
		</div>
	</g:else>
</div>

<div class="rounded-corners paginateButtons">
	<div class="left">
		<g:paginate total="${alterPageInstanceTotal}" params="['fromId':fromId]"/>
	</div>
	<div class="right">
		<g:link controller="page" action="show" id="${params.fromId}"><g:message code="default.button.back"/></g:link>
	</div>		
</div>